package cn.wolfcode.wolf2w.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
@Document("sport")
@ToString
public class Sport extends BaseDomain {

    private String name;
    private String tel;
    private Integer time;
    private Integer peoples;
    private String src;

    public String getJsonString() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", super.getId());
        map.put("name", name);
        map.put("tel", tel);
        map.put("time", time);
        map.put("peoples", peoples);
        map.put("src", src);
        return JSON.toJSONString(map);
    }
}
